home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Images and Bitmaps / ImageAtPoints / ImageAtPoints.cs next >
Encoding:
Text File  |  2001-01-15  |  873 b   |  31 lines

  1. //--------------------------------------------
  2. // ImageAtPoints.cs ⌐ 2001 by Charles Petzold
  3. //--------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class ImageAtPoints: PrintableForm
  9. {
  10.      Image image;
  11.  
  12.      public new static void Main()
  13.      {
  14.           Application.Run(new ImageAtPoints());
  15.      }
  16.      public ImageAtPoints()
  17.      {
  18.           Text = "Image At Points";
  19.  
  20.           image = Image.FromFile("..\\..\\..\\Apollo11FullColor.jpg");
  21.      }
  22.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  23.      {
  24.           grfx.DrawImage(image, new Point[] { new Point(cx / 2, 0),
  25.                                               new Point(cx,     cy / 2),
  26.                                               new Point(0,      cy / 2)});
  27.                
  28.         
  29.      }
  30. }
  31.